
export const regPhone = (curVal) => {
	const reg = /^[1][3, 4, 5, 7, 8][0-9]{9}$/;
	const bool = reg.test(curVal)
	return {
		bool: bool,
		text: bool ? '' : '手机号码不正确'
	}
}

export const regVerification = (curVal) => {
	const bool = curVal.length > 5
	return {
		bool: bool,
		text: bool ? '' : '验证码不正确'
	} 
}

export const regPassword = (curVal) => {
	const reg = /^(\w){6,20}$/;
	const bool = reg.test(curVal)
	return {
		bool: bool,
		text: bool ? '' : '只能输入6-20个字母、数字、下划线'
	}
}

export const regPassword2 = (curVal, curVal2) => {
	const bool = curVal == curVal2
	return {
		bool: bool,
		text: bool ? '' : '两次密码输入不同'
	}
}

export const regInvite = (curVal) => {
	const bool = curVal.length > 5
	return {
		bool: bool,
		text: bool ? '' : '姓名格式不正确'
	}
}

export const regName = (curVal) => {
	const reg = /^[\u4E00-\u9FA5\uf900-\ufa2d·s]{2,20}$/;
	const bool = reg.test(curVal)
	return {
		bool: bool,
		text: bool ? '' : '姓名格式不正确'
	}
}

export const regIdCards = (curVal) => {
	const reg = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X|x)$/;
	const bool = reg.test(curVal)
	return {
		bool: bool,
		text: bool ? '' : '请输入正确的身份证号'
	}
}

export const regBankCard = (curVal) => {
	const reg = /^([1-9]{1})(\d{14}|\d{18})$/;
	const bool = reg.test(curVal)
	return {
		bool: bool,
		text: bool ? '' : '请输入正确的银行卡号'
	}
}

